<?php
// Do not delete these lines

if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die('Please do not load this page directly. Thanks!');

if (post_password_required()) {
?>
<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
<?php
return;
}
?>

<!-- You can start editing here. -->

<?php if (have_comments()) : ?>

<div id="comments" class="post-comments">
    <ul class="showcomments clearfix">	
        <?php wp_list_comments('type=comment&callback=agilsun_comment'); ?>
    </ul>
</div><!-- end comments -->

<?php else : // this is displayed if there are no comments so far  ?>

<?php if ('open' == $post->comment_status) : ?>
<!-- If comments are open, but there are no comments. -->
<div class="post-comments mbs">
    <p class="nocomments">Không có bình luận.</p>
</div><!-- end comments -->

<?php else : // comments are closed  ?>
<!-- If comments are closed. -->
<p class="nocomments">Bình luận đã bị đóng.</p>

<?php endif; ?>
<?php endif; ?>

<?php if ('open' == $post->comment_status) : ?>

<div class="comments-form" id="respond">
    <h3 class="gui-binh-luan"> <i class="icon-reply"></i> <?php comment_form_title('Gửi bình luận', 'Trả lời cho %s'); ?></h3>
    <div class="proline"></div>  
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform" />      
        <textarea id="comment" name="comment" class="news-detail-textarea" rows="4" cols="50" placeholder="Nội dung..."></textarea>
        <?php if ($user_ID) : ?>
        <p>Đăng bình luận với tư cách <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php" target="_blank"><?php echo $user_identity; ?></a> (<a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Đăng xuất">Đăng xuất</a>)</p>
        <?php else : ?>
        <?php $commenter = wp_get_current_commenter(); ?>
        <input type="text" placeholder="Tên *" id="author" name="author" required value="<?php echo esc_attr( $commenter['comment_author'] ); ?>">
        <input type="text" placeholder="Email *" id="email" name="email" required value="<?php echo esc_attr( $commenter['comment_author_email'] ); ?>">
        <?php endif; ?>
        <input name="submit" class="news-detail-submit" type="submit" value="Gửi bình luận">
        <?php do_action('comment_form', $post->ID); ?>
        <?php comment_id_fields(); ?>
    </form>
</div><!-- end comments form -->

<?php endif; ?>